// hyb_yl/krecovery/pages/patient_list/patient_list.js
var app = getApp();
Page({

  /**
   * 页面的初始数据
   */
  data: {
    page:0,
    list:[],
    pagesize:10
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    var that = this;
    var zid = options.zid;
    that.setData({
      zid:zid
    })
    that.getList();
  },
  getList:function(){
    var that = this;

    app.util.request({
      'url': 'entry/wxapp/zhuanjia.getqylistser',
      data: {
        goods_id: that.data.zid,
        cerated_type: 7,
        index: 3,
        page: that.data.page,
        pagesize: that.data.pagesize
      },
      success: function (res) {
        console.log(res)
        var page = that.data.page + 1;
        that.setData({
          list: that.data.list.concat(res.data),
          page: page
        })
      }
    })
  },
  call:function(e){
    var tel = e.currentTarget.dataset.tel;
    wx.makePhoneCall({
      phoneNumber: tel,
    })
  },
  see:function(e){
    var j_id = e.currentTarget.dataset.j_id;
    var names = e.currentTarget.dataset.names;
    var tel = e.currentTarget.dataset.tel;
    var back_orser = e.currentTarget.dataset.back_orser;
    var numcard = e.currentTarget.dataset.numcard;
    var sex = e.currentTarget.dataset.sex;
    var openid = e.currentTarget.dataset.openid;
    var age = e.currentTarget.dataset.age;
    var zid = e.currentTarget.dataset.zid;
    wx.navigateTo({
      url: '/hyb_yl/krecovery/pages/postoperative_report/postoperative_report?j_id='+j_id+'&names='+names+'&telphone='+tel+'&back_orser='+back_orser+'&numcard='+numcard+'&sex='+sex+'&openid='+openid+'&age='+age+'&zid='+zid,
    })
  },
  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  }
})